package com.dormitory.manage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dormitory.manage.mapper.BuildMapper;
import com.dormitory.manage.pojo.Build;
import com.dormitory.manage.service.BuildService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 * @version 1.0
 * @description BuildServiceImpl
 * @date 2023/4/8 0008 9:04
 */
@Service
public class BuildServiceImpl extends ServiceImpl<BuildMapper, Build> implements BuildService {
    /**
    * @description 获取建筑名称列表
    *
    * @returnType java.util.List<java.lang.String>
    * @author Administrator
    * @date  9:08
    */
    @Override
    public List<Integer> getBuildNames() {
        List<Build> builds = this.baseMapper.selectList(null);
        ArrayList<Integer> buildNames = new ArrayList<>();
        for (Build build: builds) {
            buildNames.add(build.getBuildName());
        }
        return buildNames;
    }
}
